<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<!--| --------------------------------------------------------------------- |-->
	<!--|               (c) Copyright 2012 by b-and-b.li                        |-->
	<!--| --------------------------------------------------------------------- |-->
	<!--| Filename       : index.htm                                            |-->
	<!--| Description    :                                                      |-->
	<!--| Version        : 1.00                                                 |-->
	<!--| Author         : bryn lloyd                                           |-->
	<!--| Date           : march 2012                                           |-->
	<!--| --------------------------------------------------------------------- |-->
	
	<?php
		session_start();
		if (!isset($_SESSION['lang'])) {
			$_SESSION['lang'] = 'de';
		}
	?>
	<head>
		<title>Beatrice & Bryn</title>
        <!-- Include java script files -->
		<script type="text/javascript" src="session.js"></script>
		<script type="text/javascript">
			var sessionState = getUrlVariables()
		</script>
		<!-- Include style files -->
		<link type="text/css" rel="stylesheet" href="styles/style.css">
	</head>
	
    <!--| --------------------------------------------------------------------- |-->	
	<body>
		
		<div class="bodytext">
			<!-- This table is for the background image -->
            <!-- It includes the navigation links, and the main content part -->
			<!-- TODO: http://www.w3schools.com/cssref/css_colors.asp -->
			<table class="green" cellpadding="0" cellspacing="0" border="0" width="1024">
				<!-- The top part, only images -->
				<tr id="toprow">
					<td width="195">Empty column on (left)</td>
                    <td width="225">Navigation column</td>
                    <td width="390">Main content column</td>
                    <td width="214">Empty column (right)</td>
				</tr>
				<!-- The center part -->
                <tr valign="top">
                    <td width="195"></td>
                    <td width="225">
						<!-- Navigation -->
						<table class="navigation">
							<tr align="left"><th><a href="/sandbox/?rub=1" target="_self">Home</a></th></tr>
                            <tr align="left"><th><a href="/sandbox/?rub=2" target="_self">Apero Guests</a></th></tr>
                            <tr align="left"><th><a href="/sandbox/?rub=3" target="_self">Dinner Guests</a></th></tr>
                            <tr align="left"><th><a href="/sandbox/?rub=4" target="_self">Contact</a></th></tr>
						</table>
					</td>
                    <td width="390" class="green">
						<!-- Main content (depends on session state) -->
						<?php
							
							$array=array();
							parse_str($_SERVER['QUERY_STRING'], $array);
							$language = 'de';
							if (array_key_exists('lang', $array)) {
								if (strcmp($array['lang'], 'en') == 0) {
									$language = 'en';
								}
							}
							
							if (array_key_exists('rub', $array)) {
								printf( '<!-- lang = %s -->', $language );
								printf( '<!-- rub = %s -->', $array['rub'] );
								switch ($array['rub']) {
									case 1:
										printf( '<!-- %s/home.htm -->', $language );
										include(sprintf("%s/home.htm", $language));
										break;
									case 2:
										printf( '<!-- %s/apero.htm -->', $language );
										include(sprintf("%s/apero.htm", $language));
										break;
									case 3:
										printf( '<!-- %s/dinner.htm -->', $language );
										include(sprintf("%s/dinner.htm", $language));
										break;
									case 4:
										printf( '<!-- %s/contact.htm -->', $language );
										include(sprintf("%s/contact.htm", $language));
										break;
								}
							} else {
								printf( '<!-- no session info -->' );
								include("de/home.htm");
							}
						?>

					</td>
					<td width="214" class="green"></td>
				</tr>
				<!-- The bottom part, only images -->
				<tr id="bottomrow">
					<td width="195">Empty column on (left)</td>
					<td width="225">Navigation column</td>
					<td width="390">Main content column</td>
					<td width="214">Empty column (right)</td>
				</tr>
			</table>
		</div>

	</body>
</html>
